<%@ page import="util.JdbcUtil" %>
<%@ page import="java.sql.PreparedStatement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
    <script src="bootstrap/js/bootstrap.js"></script>
    <%
        int cont1 = 0;//总共多少条数据
        String sql1 = "SELECT COUNT(*) FROM record_in";
        try {
            PreparedStatement ps = JdbcUtil.getConnection().prepareStatement(sql1);
            ResultSet rs = ps.executeQuery(sql1);
            while (rs.next()) {
                cont1 = rs.getInt(1);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        int cont2 = 0;//总共多少条数据
        String sql2 = "SELECT COUNT(*) FROM record_out";
        try {
            PreparedStatement ps = JdbcUtil.getConnection().prepareStatement(sql2);
            ResultSet rs = ps.executeQuery(sql2);
            while (rs.next()) {
                cont2 = rs.getInt(1);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        session.setAttribute("cont1",cont1);
        session.setAttribute("cont2",cont2);
    %>
    <style>
        body{
            display: flex;
            flex-direction: column;

        }
        .top_div{
            font-size: 27px;
            color: black;

        }
        .xia_div{
            display: flex;
            flex-direction: row;
            
        }
        .left_div{
            display: flex;
            flex-direction: column;
            width: 50%;
            border: 1px solid #00d9ff;
             height: 300px;
             justify-content: space-between;
             font-size: 20px;
             color: rgb(41, 164, 240);
        }
        .right_div{
            display: flex;
            flex-direction: column;
            width: 50%;
            border: 1px solid rgb(41, 164, 240);
            height: 300px;
            justify-content: space-between;
           
        }
        .shi{
            display: flex;
            flex-direction: column;
            height: 150px;
        }
        .shi1{
            display: flex;
            height: 150px;
            flex-direction: column;
            justify-content: center;
        }
        .bian{
            background-color: aqua;
        }
        .lunbotu{
            margin: auto;
            width: 900px;
            height: 400px;
        }
        .xia_div{
            margin-top: 150px;
        }
        .num{
            margin: auto;
            font-size: 60px;
        }
    </style>
</head>
<body>
    <div class="top_div">&nbsp;&nbsp;&nbsp;&nbsp;   首页</div>
<div>
    <div class="lunbotu">
        <div id="carouselExampleCaptions" class="carousel slide" data-bs-ride="carousel">
            <div class="carousel-indicators">
                <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
                <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="1" aria-label="Slide 2"></button>
                <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="2" aria-label="Slide 3"></button>
            </div>
            <div class="carousel-inner">
                <div class="carousel-item active">
                    <img src="images/tu/ck1.jpg" class="d-block w-100" alt="...">
                    <div class="carousel-caption d-none d-md-block">
                        <h5>哆啦1号仓库</h5>
                        <p>非常好的一个出库，有1058个货架，在湖南长沙</p>
                    </div>
                </div>
                <div class="carousel-item">
                    <img src="images/tu/ck2.jpg" class="d-block w-100" alt="...">
                    <div class="carousel-caption d-none d-md-block">
                        <h5>哆啦2号仓库</h5>
                        <p>非常好的一个出库，有2045个货架，在广东深圳</p>
                    </div>
                </div>
                <div class="carousel-item">
                    <img src="images/tu/ck3.jpg" class="d-block w-100" alt="...">
                    <div class="carousel-caption d-none d-md-block">
                        <h5>哆啦3号仓库</h5>
                        <p>非常好的一个出库，有966个货架，在北京四环</p>
                    </div>
                </div>
            </div>
            <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="prev">
                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                <span class="visually-hidden">Previous</span>
            </button>
            <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="next">
                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                <span class="visually-hidden">Next</span>
            </button>
        </div>
    </div>
</div>

    <div class="xia_div">
        <div class="left_div">
            <div class="shi">实时出库数量 ：
                <div class="num">${cont1}</div>
            </div>
            <div class="shi">实时入库数量:
                <div class="num">${cont2}</div>
            </div>
        </div>
        <div class="right_div">
            <div style=" font-size: 20px;
           color: red;;">仓库管理人员</div>
            <div class="shi1">

                <table border="1px">
                </table>
            </div>
        </div>
    </div>
</body>
<script>
    var tbodsy = document.querySelector('tbody').querySelectorAll('tr');
    for (var i = 0; i < tbodsy.length; i++) {
        tbodsy[i].onmousemove = function () {
            this.className = 'bian';
        }
        tbodsy[i].onmouseout=function(){
            this.className='';                         
        }
    }
</script>
</html>